home *** CD-ROM | disk | FTP | other *** search
/ The Essential Home & Business Collection / The Essential Home & Business Collection.iso / 27 / 3 / 5 / HP22D5.ZIP / EXTERN / BLINK.ASM < prev    next >
Assembly Source File  |  1991-04-16  |  1KB  |  78 lines

  1. DOSSEG
  2. .MODEL        LARGE
  3.  
  4. include        extern.inc
  5.  
  6. EXTRN        GetSharedArea:FAR
  7.  
  8. .DATA
  9.  
  10. BlinkOffName      db        'blinkoff',0
  11. BlinkOnName    db        'blinkon',0
  12.  
  13. Pool        PoolStruct    <BlinkOffName,blinkoff,,HANDLER>
  14.         PoolStruct    <BlinkOnName,blinkon,,HANDLER>
  15.         PoolStruct    <>    ;END
  16.  
  17. .CODE
  18.  
  19. WhenLoaded:    retf
  20.  
  21. setblink:
  22.         push        cx
  23.         call        GetSharedArea    ;DX:AX = pointer to shared area
  24.         pop        cx
  25.  
  26.         mov        es,dx
  27.         mov        bx,ax        ;ES:BX = pointer to shared area
  28.         mov        al,es:[bx+502]    ;AL = video card type:
  29.                         ; 00 Monochrome
  30.                         ; 01 CGA
  31.                         ; 02 Extended CGA
  32.                         ; 03 Extended CGA - PLASMA
  33.                         ; 04 Hercules Monochrome
  34.                         ; 05 EGA
  35.                         ; 06 Extended EGA
  36.                         ; 07 MCGA
  37.                         ; 08 VGA
  38.                         ; 09 Extended VGA
  39.                         ; 10 Leadning EDGE Internal Graphics Adapter
  40.                         ; 11 Unknown
  41.         cmp        al,5
  42.         jl        CGAMONO
  43.         cmp        al,10
  44.         jl        EGAVGA
  45.  
  46. CGAMONO:
  47.         mov        ax,0040h
  48.         mov        es,ax        ;ES = BIOS data segment
  49.         mov        dx,es:[63h]    ;DX = address of 6845
  50.         add        dl,4        ;DL = crt mode control register
  51.         mov        al,es:[65h]    ;AL = value of crt mode ctrl
  52.         and        al,11011111b    ;zero bit 5 (blink)
  53.         or        al,ch
  54.         out        dx,al
  55.         mov        es:[65h],al    ;update BIOS info
  56.         mov        ax,STOP
  57.         retf
  58.  
  59.  
  60. EGAVGA:        
  61.         mov        bl,cl
  62.         mov        ax,1003h
  63.         int        10h
  64.         mov        ax,STOP
  65.         retf
  66.  
  67. blinkoff:
  68.         xor        cx,cx
  69.         jmp short    setblink
  70.  
  71. blinkon:
  72.         mov        cx,2001h
  73.         jmp short    setblink
  74.  
  75. END
  76.  
  77.  
  78.